<template>
  <div id="earlyStageAchievementOpinion">
    <div class="MainBox">
      <div class="boxItem boxItem1">
        <div class="boxItem_title">
          <span class="tit">项目基本信息</span>
        </div>
        <div class="boxItem_content" style="padding-top:35px;">
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>项目名称：</p>
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="submitData.projectName"
                  placement="top-start"
                >
                  <div class="boxItem_content_row_item_input">
                    <el-input readonly v-model="submitData.projectName" suffix placeholder></el-input>
                  </div>
                </el-tooltip>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>区县合格证编号：</p>
                <el-tooltip class="item" effect="dark" :content="numberData" placement="top-start">
                  <div class="boxItem_content_row_item_input">
                    <el-input v-model="numberData" readonly suffix placeholder></el-input>
                  </div>
                </el-tooltip>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>减少建设用地：</p>
                <div class="boxItem_content_row_item_input">
                  <el-input readonly v-model="submitData.yjjsj" suffix placeholder></el-input>
                  <span class="inputEndText">公顷</span>
                </div>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>新增农用地：</p>
                <div class="boxItem_content_row_item_input">
                  <el-input readonly v-model="submitData.yjzjn" suffix placeholder></el-input>
                  <span class="inputEndText">公顷</span>
                </div>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>新增耕地：</p>
                <div class="boxItem_content_row_item_input">
                  <el-input readonly v-model="submitData.yjzjg" suffix placeholder></el-input>
                  <span class="inputEndText">公顷</span>
                </div>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>项目类型：</p>
                <div class="boxItem_content_row_item_input">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="submitData.projectType"
                    placement="top-start"
                  >
                    <el-input readonly v-model="submitData.projectType" suffix placeholder></el-input>
                  </el-tooltip>
                </div>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="boxItem_content_title">
                <p>备案通知书文号：</p>
                <el-tooltip class="item" effect="dark" :content="symbolData" placement="top-start">
                  <div class="boxItem_content_row_item_input">
                    <el-input v-model="symbolData" readonly suffix placeholder></el-input>
                  </div>
                </el-tooltip>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="20">
              <div class="boxItem_content_title">
                <p>项目基本情况：</p>
                <div class="boxItem_content_row_item_textarea">
                  <el-input
                    :readonly="!isProgressShow"
                    type="textarea"
                    placeholder="请输入"
                    :rows="6"
                    resize="none"
                    v-model="submitData.projectBasicInfo"
                  ></el-input>
                </div>
              </div>
            </el-col>
          </el-row>
          <div class="btn" v-if="isProgressShow">
            <el-button @click="submit" type="primary" :loading="isLoading">提交</el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { queryProjectBasicInfo, save } from "@/api/hegezhengApplicationTable";

export default {
  data() {
    return {
      value1: "",
      fullscreenLoading: false, //整页加载
      quxianChushenTitle: "区县中心初审意见",
      quxianChushen: false, //区县初审
      piankuanList: [], //审减（增）情况表
      submitData: {
        projectName: "", //项目名称
        projectBasicInfo: "", //项目基本情况
        number: "", //编号
        symbol: "", //文号
        districtName: "", //区县
        yjjsj: "", //减少建
        yjzjn: "", //增加农
        yjzjg: "", //增加耕
        projectType: "", //项目类型
        year: ""
      },
      numberData: "", //编号输入框的数据
      symbolData: "", //文号输入框的数据
      mainData: "",
      mainDataEdit: "",
      flag: 1,
      value1: "",
      input: "",
      fuzerenCehui: "", //测绘负责人
      fuzerenCehuiJishu: "", //测绘技术负责人
      fuzerenCehuiList: [
        {
          //测绘负责人数组
          value: "选项1",
          label: "黄金糕"
        },
        {
          value: "选项2",
          label: "双皮奶"
        },
        {
          value: "选项3",
          label: "蚵仔煎"
        },
        {
          value: "选项4",
          label: "龙须面"
        },
        {
          value: "选项5",
          label: "北京烤鸭"
        }
      ],
      fuzerenCehuiJishuList: [
        {
          //测绘负责人数组
          value: "选项1",
          label: "人1"
        },
        {
          value: "选项2",
          label: "人2"
        }
      ],
      shenChaType: 1, //审查类型 1:区县中心初审意见 2:区县局初审意见
      shenchaStatus: "", //审查状态
      shencharen: "测试人", //审查人
      shencharenId: 5, //审查人
      shenChaContent: "", //审查内容
      shenChaTime: "", //审查时间

      isLoading: false,
      isProgressShow: false
    };
  },
  created() {
    if (
      localStorage.getItem("router") == "QUALIFIED_CERTIFICATE_APPLICATION_SAVE"
    ) {
      this.isProgressShow = true;
    } else {
      this.isProgressShow = false;
    }
    if (localStorage.getItem("lookStatus") == 2) {
      this.isProgressShow = false;
    }
    this.getData();
  },
  methods: {
    //提交
    submit() {
      console.log(this.submitData);
      var data = {
        projectId: localStorage.getItem("projectId"),
        projectBasicInfo: this.submitData.projectBasicInfo,
        number: this.submitData.number,
        symbol: this.submitData.symbol,
        projectName: this.submitData.projectName,
        districtName: this.submitData.districtName,
        yjjsj: this.submitData.yjjsj,
        yjzjn: this.submitData.yjzjn,
        yjzjg: this.submitData.yjzjg,
        projectType: this.submitData.projectType,
        numberStr: this.numberData,
        symbolStr: this.symbolData
      };
      this.isLoading = true;
      save(data)
        .then(res => {
          console.log(res);
          this.isLoading = false;
          if (res.code == 1000) {
            this.$alert("当前流程办理完成", "提示", {
              confirmButtonText: "确定",
              callback: action => {
                this.$router.push({
                  path: "/xmss/ywdeal"
                });
              }
            });
            this.getData();
          }
        })
        .catch(error => {
          this.isLoading = false;
        });
    },
    getData() {
      var data = {
        projectId: localStorage.getItem("projectId")
      };
      queryProjectBasicInfo(data).then(res => {
        console.log(res);
        this.submitData = {
          projectName: res.data.projectName, //项目名称
          projectBasicInfo: res.data.projectBasicInfo, //项目基本情况
          number: res.data.number, //编号
          symbol: res.data.symbol, //文号
          districtName: res.data.districtName, //区县
          yjjsj: res.data.yjjsj, //减少建
          yjzjn: res.data.yjzjn, //增加农
          yjzjg: res.data.yjzjg, //增加耕
          projectType: res.data.projectType, //项目类型
          year: res.data.year
        };
        this.numberData =
          res.data.districtName +
          "【" +
          res.data.year +
          "】" +
          " " +
          (res.data.number == "" || res.data.number == null
            ? ""
            : res.data.number + "号"); //编号输入框的数据
        this.symbolData =
          "渝国土建复备" +
          "【" +
          res.data.year +
          "】" +
          " " +
          (res.data.symbol == "" || res.data.symbol == null
            ? ""
            : res.data.symbol + "号"); //文号输入框的数据
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.btn {
  padding: 40px;
  border-top: none;
}
.money {
  font-size: 13px;
  color: #606266;
}
.projectMoney {
  padding-left: 150px;
}
#earlyStageAchievementOpinion {
  padding: 30px;
  box-sizing: border-box;
}
#earlyStageAchievementOpinion .boxItem {
  width: 100%;
  background-color: #fff;
}
#earlyStageAchievementOpinion .boxItem_title {
  width: 100%;
  background: #f8f8f8;
  height: 50px;
  border: 1px solid #efefef;
  overflow: hidden;
  color: #333;
  font-size: 18px;
  font-weight: bold;
  text-indent: 20px;
  line-height: 50px;
}
#earlyStageAchievementOpinion .boxItem_content {
  width: 100%;
  border: 1px solid #ebebeb;
  border-top: none;
  padding: 30px;
  padding-top: 0;
  box-sizing: border-box;
}

#earlyStageAchievementOpinion .boxItem_content_row_item_input {
  position: relative;
}
#earlyStageAchievementOpinion
  .boxItem_content_row_item_input
  /deep/
  .el-input__inner {
  padding-right: 50px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item_input span {
  position: absolute;
  right: 10px;
  top: 3px;
  height: 36px;
  line-height: 36px;
  z-index: 1;
  color: #999;
}
.boxItem_content_row_item_textarea {
  width: 100%;
}
.boxItem_content_row {
  display: flex;
  align-items: center;
}
.boxItem_content_title {
  margin-bottom: 20px;
}
.boxItem_content_title p {
  font-size: 14px;
  font-weight: bold;
  color: #606266;
}
.boxItem_content_row_item_input {
  width: 50%;
}
</style>
 